Available as methods for compressing information such as voice and images are a lossy encoding method that permits distortion and a lossless encoding that does not permit distortion. Various lossy compression methods are known based on standards of ITU-T (International Telecommunications Union-Telecom Standardization) or ISO/IEC MPEG (International Organization for Standardization/International Electrotechnical Commission Moving Picture Experts Group). The use of these lossy compression methods allows a digital signal to be compressed to 1/10 or less while controlling distortion to a minimum. However, the distortion depends on encoding conditions and input signals, and the degradation of a reproduced signal becomes problematic depending on types of applications.
On the other hand, universal compression encoding techniques widely used to compress files and texts in a computer are known as a lossless compression method to fully reproduce an original text. With this technique, any signal can be compressed, and a text is typically compressed to about half the original amount. If directly applied to voice and video data, a resulting compression ratio is 20 percent or so.
Lossless compression is performed at a high compression ratio by combining a lossy encoding operation at a high compression ratio and lossless compression of an error between a reproduced signal and the original signal thereof. This combination compression method is proposed in Japanese Patent Application Publication No. 2001-44847 “Lossless Encoding Method, Lossless Decoding Method, Apparatuses and Program Storage Medium for Performing These Methods”. This technique is disclosed, and will now be briefly discussed.
In an encoder, a frame splitter successively splits an input digital signal (hereinafter referred to as an input signal sample chain) into frames, each frame containing 1024 input signal samples. The digital signal is lossy compression encoded on a per frame basis. Any encoding method appropriate for the input signal may be used as long as the original input digital signal is reconstructed to some degree through a decoding process. For example, if the digital input signal is voice, voice encoding recommended as G. 729 Standard of ITU-T may be used. If the digital input signal is music, Twin VQ (Transform-Domain Weighted Interleaved Vector Quantization) encoding adopted in MPEG-4 may be used. Alternatively, the lossy encoding method disclosed in the previously cited publication may be used. The lossy compressed code is then partially decoded, and an error signal between the partial signal and the original digital signal is generated. In practice, partial decoding is not required, and it is sufficient to determine an error between a quantization signal obtained during the generation of a lossy compression code and the original digital signal. The amplitude of the error signal is typically substantially smaller than the amplitude of the original digital signal. The amount of information is set to be smaller in the lossless compression encoding of the error signal than in the lossless compression encoding of the original digital signal.
To enhance the efficiency in the lossless compression encoding, a bit string is formed with bits chained in the direction of sample chain (direction of time) at each bit position, namely, MSB, second MSB, . . . , LSB, with respect to all samples in a frame in a sample chain in sign and absolute value representation of the error signal (binary values of a sign and an absolute value). In other words, a bit array is converted. A bit string of chained 1024 bits at the same position is here referred to as “equidistant bit string”. In contrast, a bit string of one word representing an amplitude value containing the polarity of each sample is here referred to as “amplitude bit string.” Since the error signal is small in amplitude, one bit or a plurality of bits below the most significant bit in each sample are typically “0”. By representing an equidistant bit string chained and generated at the bit position by a predetermined sign, the lossless compression encoding efficiency of the error signal is heightened.
The equidistant bit string is thus lossless compression encoded. The lossless compression encoding may be an entropy coding such as a Huffman coding or arithmetic coding. The entropy coding may be used when the same sign (1 or 0) is consecutively repeated in a chain or frequently appear in a chain.
A decoding side decodes the lossless compressed code, and the decoded signal is then subjected to the bit array inverse conversion. In other words, the equidistant bit string is converted into the amplitude bit string on a per frame basis. The resulting error signals are successively reproduced. A lossy compressed code is also decoded. The decoded signal and the reproduced error signal are summed, and the summed signals are successively chained on a frame-by-frame basis, and the original digital signal string is thus reproduced.
The object of the present invention is to compress a digital signal and to provide an encoding method, a decoding method, an encoding apparatus, a decoding apparatus, and programs therefor for allowing a selection of a layered sampling rate.